﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;


public class PayEaseUtil
{
    /// <summary>
    /// 商户编号
    /// </summary>
    public static string v_mid = "3050";

    /// <summary>
    /// MD5指纹密钥
    /// </summary>
    public static string md5_key = "zhouyujie2382380";

    /// <summary>
    /// 系统默认收货人姓名
    /// </summary>
    public static string s_v_rcvname =  "anhuashuntong.Inc";

    /// <summary>
    /// 系统默认收货人地址
    /// </summary>
    public static string s_v_rcvaddr = "朝阳区珠江帝景E区5号楼1505室";

    /// <summary>
    /// 系统默认收货人电话
    /// </summary>
    public static string s_v_rcvtel = "13581820082";

    /// <summary>
    /// 系统默认收货人邮编
    /// </summary>
    public static string s_v_rcvpost = "100022";

    /// <summary>
    /// 系统默认返回商户页面地址(及时返回结果)
    /// </summary>
    public static string im_v_url = "http://www.f980.com/PayEase/ImmediateResult.aspx"; // "http://www.sina.com";// 

    /// <summary>
    /// 系统默认返回商户页面地址(延迟返回结果)
    /// </summary>
    public static string del_v_url = "http://www.f980.com/PayEase/DelayResult.aspx";


    /// <summary>
    /// 提交订单生成数字指纹，供v_md5info使用
    /// </summary>
    /// <param name="v_moneytype"></param>
    /// <param name="v_ymd"></param>
    /// <param name="v_amount"></param>
    /// <param name="v_rcvname"></param>
    /// <param name="v_oid"></param>
    /// <param name="v_mid"></param>
    /// <param name="v_url"></param>
    /// <returns></returns>
    public static string Hex_MD5Info(string v_moneytype, string v_ymd, string v_amount, string v_rcvname, string v_oid, string v_mid, string v_url)
    {
        string result = string.Empty;
        string allStr = v_moneytype + v_ymd + v_amount + v_rcvname + v_oid + v_mid + v_url;
        ClassHmac2003.ClassHmac cc = new ClassHmac2003.ClassHmac();
        result =cc.hex_hmac_md5 (allStr,md5_key );
        return result;
    }

        
}

/// <summary>
/// 首信易支付平台订单配货状态
/// </summary>
public enum PayEase_OrderStatus
{ 
    /// <summary>
    /// 未配齐
    /// </summary>
    NotReady=0,

    /// <summary>
    /// 已配齐
    /// </summary>
    AllReady 
}


/// <summary>
/// 首信易支付平台支付币种
/// </summary>
public enum PayEase_MoneyType
{
    /// <summary>
    /// 人民币
    /// </summary>
    RMB =0 ,

    /// <summary>
    /// 美元
    /// </summary>
    Dollar 
}
